// 表格列
export const columns = [
  { title: '序号', dataIndex: 'index', key: 'index', width: 50, fixed: 'left', align: 'center', customRender: ({ index }) => index + 1 },
  { title: '状态', dataIndex: 'status', key: 'status', width: 100, bodySlot: 'status', fixed: 'left' },
  { title: '合同编号', dataIndex: 'contractNo', key: 'contractNo', width: 100, ellipsis: true },
  { title: '合同方', dataIndex: 'counterparty', key: 'counterparty', width: 180, ellipsis: true },
  { title: '合同标的物', dataIndex: 'subject', key: 'subject', width: 120, ellipsis: true },
  { title: '规格型号', dataIndex: 'specification', key: 'specification', width: 120, ellipsis: true },
  { title: '合同签订时间', dataIndex: 'signDate', key: 'signDate', width: 100 },
  { title: '合同有效期', dataIndex: 'validityPeriod', key: 'validityPeriod', width: 200 },
  { title: '合同单价（元、不含税）', dataIndex: 'unitPriceTaxExcluded', key: 'unitPriceTaxExcluded', width: 200 },
  { title: '合同单价（元、含税）', dataIndex: 'unitPriceTaxIncluded', key: 'unitPriceTaxIncluded', width: 200 },
  { title: '计量单位', dataIndex: 'unit', key: 'unit', width: 100 },
  { title: '合同数量', dataIndex: 'quantity', key: 'quantity', width: 80 },
  { title: '合同金额（万元，不含税）', dataIndex: 'amountTaxExcluded', key: 'amountTaxExcluded', width: 200 },
  { title: '剩余采购量', dataIndex: 'remainingPurchaseQuantity', key: 'remainingPurchaseQuantity', width: 100 },
  { title: '执行量（吨）', dataIndex: 'executedQuantity', key: 'executedQuantity', width: 120 },
  { title: '合同执行率%', dataIndex: 'executionRate', key: 'executionRate', width: 120 },
  {
    title: '月份',
    dataIndex: 'month',
    key: 'month',
    width: 100,
    customRender: ({ text }) => {
      if (!text) return '-'
      const [year, month] = text.split('-')
      return `${year}年${month}月`
    },
  },
  { title: '操作', dataIndex: 'action', key: 'action', width: 80, bodySlot: 'action', fixed: 'right' },
]
// 数据状态
export const statusData = [
  {
    label: '全部',
    value: 0,
    color: '#165Dff',
    query: null,
  },
  {
    label: '待匹配',
    value: 0,
    color: '#FB4246',
    query: 0,
  },
  {
    label: '已匹配',
    value: 0,
    color: '#03c683',
    query: 2,
  },
  {
    label: '已完成',
    value: 0,
    color: '#777777',
    query: 3,
  },
]
export const excelParam = {
  fileName: '合同台账模板.xlsx',
  downLoadUrl: 'http://192.168.1.99:9000/bee-mall/合同台账模板.xlsx',
  api: '/admin/contract/import',
}

// 表单模型
export const formModel = {
  id: null,
  status: '',
  contractNo: '',
  counterparty: '',
  subject: '',
  signDate: null,
  validityPeriod: '',
  unitPriceTaxExcluded: null,
  unitPriceTaxIncluded: null,
  unit: '',
  quantity: null,
  amountTaxExcluded: null,
  remainingPurchaseQuantity: null,
  executedQuantity: null,
  executionRate: null,
  month: null,
}
